package com.qiyu.dubbo.router.starter.zone.nacos;

import com.alibaba.nacos.api.naming.NamingService;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.registry.Registry;
import org.apache.dubbo.registry.support.AbstractRegistryFactory;

/**
 * @Author idea
 * @Date created in 5:58 下午 2020/11/25
 */
public class ZoneAwareNacosRegisterFactory extends AbstractRegistryFactory {

    private NamingService namingService;

    public void setNamingService(NamingService namingService){
        this.namingService = namingService;
    }

    @Override
    protected Registry createRegistry(URL url) {
        return new ZoneAwareNacosRegister(url,namingService);
    }
}
